
/*无邮箱*/
function factory (UserModel) {
  return function (req, res) {
    var body = req.body;
    UserModel.findOne({user:body.user}, function (err, user) {
      if (!user) {
        res.send('-1')
      }else {
        if ((user.user !== body.user ) || user.password !== body.password) {
          res.send('0')
        }else {
          user.save(function (err,user) {
            res.send(user)
          })
        }
      }
    })
  }

}

module.exports = factory